package com.metacube.questionbank.jdbc;

import java.sql.ResultSet;
import java.sql.SQLException;

import org.springframework.dao.DataAccessException;
import org.springframework.jdbc.core.ResultSetExtractor;

import com.metacube.questionbank.dto.TagDTO;

public class TagExtractor implements ResultSetExtractor<TagDTO> {
	TagDTO tagDTO = new TagDTO();

	public TagDTO extractData(ResultSet res) throws SQLException, DataAccessException{

		try {

			tagDTO.setTagId(res.getInt("TAGID"));
			tagDTO.setTagName(res.getString("TAGNAME"));
			tagDTO.setIsActive(res.getInt("ISACTIVE"));
			tagDTO.setDescription(res.getString("DESCRIPTION"));

		} catch (SQLException e) {

			System.out.println("Error While Set tag data to list" + e.getMessage());
		}
		return tagDTO;
	}

}
